package org.bao.service.impl;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.annotation.Resource;

import org.bao.bean.shoppingcarBean;
import org.bao.dao.shoppingcarDao;
import org.bao.service.IshoppingCar;
import org.springframework.stereotype.Service;

@Service("CarS")
public class ShoppingCar implements IshoppingCar {

	@Resource
	private shoppingcarDao shCarD; // 按类型匹配进行注入

	@Override
	public List<?> Queryphone(Integer tel) {

		// 查询购物车信息
		List<?> lisidAndNum = shCarD.selectByUid2PhoneCar(tel);

		System.out.println("用户ID是" + tel + "的购物车数据:" + lisidAndNum);

		return lisidAndNum;
	}

	@Override
	public int insertShoCar(shoppingcarBean shoCarB) {

		int count = shCarD.insertSelective(shoCarB);
		System.out.println("执行成功数据:" + count);
		return count;
	}

}
